import { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/layout/first-layout-index.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/demo',
    component: () => import('@/views/demo/index.vue'),
    children: [
      {
        path: '',
        name: 'demo',
        component: () => import('@/views/demo/demo.vue')
      },
      {
        path: 'screening',
        name: 'screening',
        component: () => import('@/views/demo/screening.vue')
      },
      {
        path: 'beforeunload',
        name: 'beforeunload',
        component: () => import('@/views/demo/beforeunload.vue')
      },
      {
        path: 'table',
        name: 'table',
        component: () => import('@/views/demo/table.vue')
      },
      {
        path: 'router/:paramsId',
        name: 'router',
        component: () => import('@/views/demo/router.vue')
      },
      {
        path: 'forms',
        name: 'forms',
        component: () => import('@/views/demo/forms.vue')
      },
      {
        path: 'openai',
        name: 'openai',
        component: () => import('@/views/demo/openai.vue')
      },
      {
        path: 'dragout',
        name: 'dragout',
        component: () => import('@/views/demo/dragout.vue')
      }
    ]
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/not-found.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404'
  }
];

export default routes;
